Corruption of storage devices, such as corrupted DVD/CD disks, or channel transmission noise are common sources of bit errors in encoded video bitstreams. These bit errors are a serious problem in video decoding. Even one bit of corruption in the encoded stream can cause decoder to lose bitstream synchronization due to variable length coding (VLC) nature of the entropy encoding commonly used in video encoding. A single bit error can cause the decoder to fail to correctly decode further data from the error position to the next resynchronization marker (RM).
Corruption of the received video bitstream may result in any or all of three problems. The first problem is loss of bitstream synchronization. Loss of bitstream synchronization in the video decoder prevents correct syntax decoding from that point until the next RM. Corruption of the video bitstream may result in an incorrect state in the video decoder and display of incorrectly decoded data. This corruption may result in an incorrect state in the video decoder causing instability which may lead the video decoder to hang or crash. Finally, due to the presence of predicted regions and frames within a video bitstream any decoding error may result in error propagation into subsequent video frames. This error propagation may occur following video decoder resynchronization due to prediction from incorrect data.
Detection of corrupted data in video bitstreams on video decoding introduces a further problem. Due to the variable length codes a corrupted bit or bits may not be immediately detected. Video decoders typically detect bit corruption by detection of an invalid symbol. An invalid symbol may be detected by detection of an out of range value, an incorrect number of macroblocks or other illegal codeword. Detection of such an invalid symbol may be triggered directly by a corrupted bit. However, a corrupted bit may not immediately result in detection of an invalid symbol. Lots of bit errors in the stream remain undetectable due to variable length nature of the coded bitstream. A corrupted bit may cause the video decoder to determine that data following the corrupted bit are valid symbols. In this case the decoder will not detect the error though it will parse data following the corrupted bit incorrectly. This situation may prevail for an indeterminate length of time before the video decoder detects an invalid symbol.
Accordingly, detection of an invalid symbol makes any following data before the next resynchronization marker (RM) invalid. Prior art video decoders generally abort decoding in this case until the next resynchronization marker (RM). This results in loss of picture for this interval but avoids propagating errors. Because invalid symbol detection may occur long after the first corrupted bit in that slice, the authenticity of the bits before the error detection position back to previous RM is questionable. This is due to the uncertainty of the error location which may not the same location as that of error detection. Many video decoders drop all bits of that slice upon such error detection. A slice is an independently decodable unit including a resynchronization marker (RM) followed by the video encoded data until the next RM. Discarding an entire slice of data prevents displaying erroneously reconstructed macroblocks and propagating errors. However if the bit error rate is high of the order of 10−4 or 10−3 making it likely that every alternate picture is corrupted, throwing away good bits such as correctly decoded bits before the error position, results in very poor picture quality. The amount of good bits discarded upon error detection position can be controlled by inserting more than one RM per frame. The decision on the number of slices per frame is made at the video encoder. The video decoder has no control over it. When a frame is coded as a single slice even few corrupted bits per frame may result in loss of the entire frame.
Other video decoders assume that all data before the error detection is correct. This technique discards no valid data. However due to the location of the corrupted bit not necessarily being the location of the error detection, this technique results in decoding erroneous data. Errors caused by this erroneous decoding will generally propagate to later frames due to the use of prediction.